//
// Created by hsj on 2022/1/18.
//

#ifndef CLION_CPP_T_CLASS_POINTER_H
#define CLION_CPP_T_CLASS_POINTER_H
#include <string>
namespace hsj_class_pointer{
    using std::string;
    using std::cout;
    using std::endl;

    //测试指向对象的指针
    //带有定位new运算符的析构函数【显示调用析构函数】
    void tst_class_pointer();

    class JustTesting{
        private:
            string words;
            int number;
        public:
            JustTesting(const string & s = "Just Testing",int n = 0){
                words = s;
                number = n;
                cout<<words<<" constructor."<<endl;
            };
            ~JustTesting(){
                cout<<words<<" destoryed."<<endl;
            };
            void show() const{
                cout<<words<<" number."<<endl;
            };
    };

}
#endif //CLION_CPP_T_CLASS_POINTER_H
